from django.contrib import admin
from muser.models import *


class ReservingInline(admin.StackedInline):
	model = Reserving
	extra = 1

class ReadingInline(admin.StackedInline):
	model = Reading
	extra = 1

class UserProfileAdmin(admin.ModelAdmin):
	inlines = [ReadingInline, ReservingInline]

class BookProfileAdmin(admin.ModelAdmin):
	inlines = [ReadingInline, ReservingInline]
	list_display = ['book', 'num_available', 'num_total', 'num_reserving']

admin.site.register(UserProfile, UserProfileAdmin)
admin.site.register(BookProfile, BookProfileAdmin)
